package com.wang.service.impl;

import com.wang.bean.Singlechoice;
import com.wang.bean.SinglechoiceResults;
import com.wang.bean.SinglechoiceSubmissionLog;
import com.wang.bean.SysUserEntity;
import com.wang.mapper.*;
import com.wang.service.SinglechoiceResultsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SinglechoiceResultsServiceImpl implements SinglechoiceResultsService {

    @Autowired
    private SinglechoiceResultsMapper singlechoiceResultsMapper;

    @Autowired
    private SinglechoiceMapper singlechoiceMapper;

    @Autowired
    private SysUserMapper sysUserMapper;

    @Autowired
    private SinglechoiceSubmissionLogMapper singlechoiceSubmissionLogMapper;

    @Override
    public SinglechoiceResults findSinglechoiceResultsByUserSinglechoiceId(SinglechoiceResults singlechoiceResults) {
        return singlechoiceResultsMapper.findSinglechoiceResultsByUserSinglechoiceId(singlechoiceResults);
    }

    @Override
    public List<SinglechoiceResults> findSinglechoiceResultsByUserId(SinglechoiceResults singlechoiceResults) {
        return singlechoiceResultsMapper.findSinglechoiceResultsByUserId(singlechoiceResults);
    }

    @Override
    public List<SinglechoiceResults> findSinglechoiceResultsBySinglechoiceId(SinglechoiceResults singlechoiceResults) {
        return singlechoiceResultsMapper.findSinglechoiceResultsBySinglechoiceId(singlechoiceResults);
    }

    @Override
    public List<SinglechoiceResults> findSinglechoiceResultsAll() {
        return singlechoiceResultsMapper.findSinglechoiceResultsAll();
    }

    @Override
    public void addSinglechoiceResults(SinglechoiceResults singlechoiceResults) {
        singlechoiceResultsMapper.addSinglechoiceResults(singlechoiceResults);
    }

    @Override
    public void updateSinglechoiceResults(SinglechoiceResults singlechoiceResults) {
        singlechoiceResultsMapper.updateSinglechoiceResults(singlechoiceResults);
    }

    @Override
    public Singlechoice selectoneSinglechoice(Long singlechoice_id) {
        return singlechoiceMapper.selectoneSinglechoice(singlechoice_id);
    }

    @Override
    public SysUserEntity selectOneById(Long user_id) {
        return sysUserMapper.selectOneById(user_id);
    }

    @Override
    public List<SinglechoiceSubmissionLog> findsinglechoicesubmissionlog() {
        return singlechoiceSubmissionLogMapper.findsinglechoicesubmissionlog();
    }

    @Override
    public void addsinglechoicesubmissionlog(SinglechoiceSubmissionLog singlechoiceSubmissionLog) {
        singlechoiceSubmissionLogMapper.addsinglechoicesubmissionlog(singlechoiceSubmissionLog);
    }
}
